/** \file
 *	\brief Interface for a step algorithm.
 */

#ifndef MDS_STEP_INCLUDED
#define MDS_STEP_INCLUDED 1

#include "../mds/frame.h"

typedef void (*mds_step_upgrade_proc)( mds_frame *, void *data );
typedef void (*mds_step_init_dt_proc)( mds_frame *, Real dt, void *data );


/** \brief Step interface.
 *
 */
typedef struct
{
	mds_step_upgrade_proc predict;  /*!< Verlet/Beeman/... predictor    */
	mds_step_upgrade_proc correct;  /*!< Verlet/Beeman/... corrector    */
	mds_step_init_dt_proc init_dt;  /*!< Verlet/Beeman/... setup dt     */
	void                 *data;     /*!< Verlet/Beeman/... working data */
	size_t                num_sets; /*!< Verlet/Beeman/... frame->num_sets */
} mds_step;

#define MDS_STEP_INIT { NULL, NULL, NULL, NULL, 0 }

/** \brief do nothing step */
void mds_nothing_step_load( mds_step *step, void *data);

/** \brief intialize time step
 *  
 *	calls step->init_dt( frame, dt, step->data );
 */
void mds_step_init_dt( mds_step *step, mds_frame *frame, Real dt );

/** \brief prediction from current accelerations 
 *	
 *	Calls step->predict( frame, step->data );
 *	\warning step->predict must take care of the frame PBC.
 */
void mds_step_predict( mds_step *step, mds_frame *frame );

/** \brief correction from new accelerations
 *
 *	\warning step->correct must take care of the frame PBC.
 */
void mds_step_correct( mds_step *step, mds_frame *frame );





#endif
